package com.yunxun.coinmessage.dao;
import com.yunxun.coinmessage.entity.ClassifiedPacket;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


@Mapper
@Component

public interface ClassifiedPacketDao {
    //查询所有分类
    List<ClassifiedPacket> findAll() ;
    //分类总计
    Integer getTotal();
    //添加分类
    void add(ClassifiedPacket classifiedPacket);
    //按类名查询记录数
    Integer findByName(@Param("pname") String pname);
   //根据id删除记录
    void deleteById(Integer pid);

    @Select("select * from classified_packet where pid=#{pid}")
    ClassifiedPacket findById(@Param("pid") Integer pid);

    @Update("update classified_packet set pname=#{pname},pintro=#{pintro} where pid=#{pid}" )
    Integer updateById(ClassifiedPacket classifiedPacket);
}






